Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: case court report modal ui changes #6185

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

alex-yi37
Copy link

@alex-yi37 alex-yi37 commented Jan 23, 2025

What github issue is this PR for, if any?

Resolves #5888, #6165

What changed, and why?

This PR changes the modal displayed at /case_court_reports by constraining the width of the select options seen when the modal is opened. Currently, if an option is long enough it will overflow through the side of the modal, after these changes it is truncated with ellipses. It also now displays an error message when a user tries to generate a report without first making a selection and clears the error when a selection is made or the modal is closed. Closing the modal will also reset the selected case.

How is this tested? (please write tests!) 💖💪

Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system

Screenshots please :)

Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.

Before: signed in as admin, selecting a long case option - there is no border around the option and it overflows when too long

image

Before: signed in as admin, trying to generate a report with no case selected. Does not tell user that selection is required, and keeps selection when modal is closed

test-vid-1.mov

After: signed in as admin, selecting a long case option - there's a border around the select element and it gets truncated with ellipses

image

After: signed in as admin, trying to generate report with case selected displays an error message. Making a selection clears the error. Closing the modal clears the error and also resets the selection

Screen.Recording.2025-01-24.at.12.50.35.AM.mov

After: signed in as volunteer, select border styles are consistent with admin styles and error message still appears when trying to generate report without selecting an option

image

Feelings gif (optional)

What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:

![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)

makes the generate doc select element required, validates on form submit, clears form errors when changing the select, clears the errors on modal close, adds styles to regular select as well as the select2 select element
@github-actions github-actions bot added javascript for use by Github Labeler to mark pull requests that update Javascript code erb labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erb javascript for use by Github Labeler to mark pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve report generation modal from sidebar
1 participant